package io.bsly.modules.app.service.sourceDb.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.bsly.common.utils.PageUtils;
import io.bsly.common.utils.Query;
import io.bsly.modules.app.dao.sourceDao.RoomTypeDao;
import io.bsly.modules.app.entity.sourceEntity.CanalsRoomEntity;
import io.bsly.modules.app.entity.sourceEntity.RoomEntity;
import io.bsly.modules.app.entity.sourceEntity.RoomStatusEntity;
import io.bsly.modules.app.entity.sourceEntity.RoomTypeEntity;
import io.bsly.modules.app.pojo.HotelRoomTypeVo;
import io.bsly.modules.app.pojo.RoomTypeFrom;
import io.bsly.modules.app.service.sourceDb.CanalsRoomService;
import io.bsly.modules.app.service.sourceDb.RoomService;
import io.bsly.modules.app.service.sourceDb.RoomStatusService;
import io.bsly.modules.app.service.sourceDb.RoomTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@DS("slave")
@Service("roomTypeService")
public class RoomTypeServiceImpl extends ServiceImpl<RoomTypeDao, RoomTypeEntity> implements RoomTypeService {



    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<RoomTypeEntity> page = this.page(
                new Query<RoomTypeEntity>().getPage(params),
                new QueryWrapper<RoomTypeEntity>()
        );
        return new PageUtils(page);
    }



    @Override
    public List<HotelRoomTypeVo> getDetailWithTypeData(Integer hotelId) {
        List<HotelRoomTypeVo> list = this.baseMapper.getDetailWithTypeData(hotelId);
        return list;
    }

}